<?php

namespace app\common\model\haipi;


use think\Model;
use app\common\model\User;

class Order extends Model
{
    protected $name = 'haipi_order';

    protected $autoWriteTimestamp = 'datetime';

    const ORDER_STATUS_NOPAY = 0;

    const ORDER_STATUS_PAIED = 1;

    # 支付类型, 1: 余额支付
    const PAY_TYPE_BALANCE = 'pay_balance';
    # 支付类型, 2: 微信支付
    const PAY_TYPE_WECHAT = 'pay_wechat';
    # 支付类型, 3: 支付宝支付
    const PAY_TYPE_ALIPAY = 'pay_alipay';


    # 商品类型, 1: 升级VIP
    const GOODS_TYPE_VIP = 1;


    public function user(){
        return $this->belongsTo(User::class,'user_id','id');
    }
}